<?php

class SiolProtect
{
	private $channels;
	public function __construct()
	{
		$this->Load();
	}
	
	public function IsChannelProtected($channel_id)
	{
		$ret = false;
		foreach ($this->channels as $channel)
		{
			if ($channel_id == $channel)
			{
				$ret = true;
				break;
			}
		}
		//TODO:
		return $ret;
	}
	
	private function Load()
	{
		$this->channels = array();
		$m3u_lines = file(SiolConfig::PROTECTED_LIST_FILE, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
		for ($i = 0; $i < count($m3u_lines); ++$i)
		{
			array_push($this->channels, $m3u_lines[$i]);
		}
	}
}

?>
